<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			//int num;
			//只是声明变量，没有赋值，现在的值是undefined
			var v;
			console.log(v);//undefined
			console.log(typeof(v));//undefined
			v = 3.14;
			console.log(v);//3.14
			console.log(typeof(v));//number
			v = 'js';
			console.log(v);//js
			console.log(typeof(v));//string
			v = true;
			console.log(v); //true
			console.log(typeof(v));//boolean
			v = null;
			console.log(v); //null
			console.log(typeof(v));//object
			
			var n = 3;
			if(m == n){// ==值相等就可以
				console.log('m==n')
			}
			if(m === n){// ===值相等，类型也要相同
				console.log('m===n')
			}
			
			var str1 = 'Hello JS and Java';
			console.log(str1.indexOf('J'));//6
			console.log(str1.indexOf('JS'));//6
			console.log(str1.indexOf('JS',9));//-1
			var str2 = 'how are you doing taday';
			var array = str2.split(' ');//空格分开
			console.log(array);
			console.log(array[0]);//下表是零的字母
			console.log('1:2:3:4'.split(':'));
			
			console.log('----------');
			if(true){
				console.log('true');
			}
			if(0){//false
				console.log('0');
			}
			if(!0){//true
				console.log('!0');
			}
			if(1{//true
				console.log('1');
			}
			if(''){//false
				console.log('空字符串');
			}
			if('abc'){//true
				console.log('abc');
			}
			
		</script>
	</body>
</html>